<cfcomponent extends="base">

<cffunction name="GET" returntype="any" access="public">

<cfinvoke component="data" method="get_all" returnvariable="get_all">

<cfinvoke component="base" method="build_sub_admin_nav" returnvariable="build_sub_admin_nav" calling_cfc="System Configuration">
<div>&nbsp;</div>

<table width="100%" cellspacing="3">


<tr>
<td width="100%">
<!---    --->
<cfinvoke component="data" method="get_5_star_area" returnvariable="get_5_star_area" >
<table width="100%"  align="left"  id="get_5_star_area" class="datagrid2" cellspacing="3" onmouseover="$(this).css({'background-color': '#CCCCCC'});" onmouseout="$(this).css({'background': 'none'});">

<tbody>
<tr><td align="left" width="100%">
<form method='post' name='add_area' action='' class="config_form">
<input type="hidden" name="form_type" value="add_new_area">
Add 5 Star Area: <input type="text" id="new_area" class="" name="new_area" value="" size="20">&nbsp;
<input type="submit" value="Add New Area" class="button">

</form>
</td>
</tr>
<tr>
<td align="left" width="100%">
<form method='post' name='edit_area' action=''>
<input type="hidden" name="form_type" value="edit_area">
Edit 5 Star Area: <select id="edit_5_star_area" name="edit_5_star_area"><cfloop query="get_5_star_area"><cfoutput><option 
value="#get_5_star_area.area#">#left(get_5_star_area.area,25)#</option></cfoutput></cfloop></select>&nbsp;<input type="text" 
id="edit_5_star_area_text" class="" name="edit_5_star_area_text" value="" size="20">&nbsp;
<input type="submit" value="Edit Area" class="button">

</form>
</td>
</tr>
<tr>
<td align="left" width="100%">
<form method='post' name='delete_area' action=''>
<input type="hidden" name="form_type" value="delete_area">
Delete 5 Star Area: <select id="delete_5_star_area" name="delete_5_star_area"><cfloop query="get_5_star_area"><cfoutput><option 

value="#get_5_star_area.area#">#get_5_star_area.area#</option></cfoutput></cfloop></select>&nbsp;
<input type="submit" value="Delete Area" class="button">
</form>
</td>
</tr>

</tbody>
</table>
<!---    --->
</td>
</tr>

<tr>
<td>
<!---    --->
<cfinvoke component="data" method="get_all_category" returnvariable="get_all_category" >
<table width="100%"  align="left"  id="get_all_category" class="datagrid2" cellspacing="3" onmouseover="$(this).css({'background-color': '#CCCCCC'});" onmouseout="$(this).css({'background': 'none'});">
<tbody>
<tr><td align="left" width="100%">
<form method='post' name='add_category' action=''>
<input type="hidden" name="form_type" value="add_new_category">
Add 5 Star Category: <input type="text" id="new_category" class="" name="new_category" value="" size="20">&nbsp;
Parent Area: <select id="parent_5_star_area" name="parent_5_star_area"><cfloop query="get_5_star_area"><cfoutput><option
value="#get_5_star_area.five_star_area_category_id#">#left(get_5_star_area.area,25)#</option></cfoutput></cfloop></select>&nbsp;
&nbsp;<input type="submit" value="Add New Category" class="button">

</form>
</td>
</tr>
<tr>
<td align="left" width="100%">
<form method='post' name='edit_category' action=''>
<input type="hidden" name="form_type" value="edit_category">
Edit 5 Star Category: <select id="edit_5_star_category" name="edit_5_star_category"><cfloop query="get_all_category"><cfoutput><option
value="#get_all_category.area#">#left(get_all_category.area,25)#</option></cfoutput></cfloop></select>&nbsp;<input type="text" id="edit_5_star_category_text" class="" name="edit_5_star_category_text" value="" size="20">&nbsp;<input type="submit" value="Edit Category" class="button">
</form>
</td>
</tr>
<tr>
<td align="left" width="100%">
<form method='post' name='delete_category' action=''>
<input type="hidden" name="form_type" value="delete_category">
Delete 5 Star Category: <select id="delete_5_star_category" name="delete_5_star_category"><cfloop query="get_all_category"><cfoutput><option
value="#get_all_category.area#">#get_all_category.area#</option></cfoutput></cfloop></select>&nbsp;<input type="submit" value="Delete Category" class="button">
</form>
</td>
</tr>

</tbody>
</table>
<!---    --->
</td>
</tr>


<tr>
<td>
<!---    --->
<cfinvoke component="data" method="companys" returnvariable="companys" >
<table width="100%"  align="left"  id="companys" class="datagrid2" cellspacing="3" onmouseover="$(this).css({'background-color': '#CCCCCC'});" onmouseout="$(this).css({'background': 'none'});">

<tbody>
<tr><td align="left" width="100%">
<form method='post' name='add_company' action=''>
<input type="hidden" name="form_type" value="add_new_company">
Add Company: <input type="text" id="new_company" class="" name="new_company" value="" size="20">&nbsp;
<input type="submit" value="Add New Company" class="button">

</form>
</td>
</tr>
<tr>
<td align="left" width="100%">
<form method='post' name='edit_company' action=''>
<input type="hidden" name="form_type" value="edit_company">
Edit Company: <select id="edit_company" name="edit_company"><cfloop query="companys"><cfoutput><option value="#companys.company#" <cfif "#companys.first_choice#" neq 1><cfelse>style="color:red;"</cfif>>#left(companys.company,25)#</option></cfoutput></cfloop></select>&nbsp;<input type="text" id="edit_company_text" class="" name="edit_company_text" value="" size="20">
<input type="checkbox" id="editfirst_choice" name="editfirst_choice" value="1">&nbsp;Default?&nbsp;
<input type="submit" value="Edit Company" class="button">

</form>
</td>
</tr>
<tr>
<td align="left" width="100%">
<form method='post' name='delete_company' action=''>
<input type="hidden" name="form_type" value="delete_company">
Delete Company: <select id="delete_company_" name="delete_company_"><cfloop query="companys"><cfoutput><option 
value="#companys.company#">#companys.company#</option></cfoutput></cfloop></select>&nbsp;<input type="submit" value="Delete Company" class="button">
</form>
</td>
</tr>

</tbody>

</table>
<!---    --->
</td>
</tr>


<tr>
<td>
<!---    --->
<cfinvoke component="data" method="get_poc_type" returnvariable="get_all">
<table width="100%"  align="left"  id="get_poc_type" class="datagrid2" cellspacing="3" onmouseover="$(this).css({'background-color': '#CCCCCC'});" onmouseout="$(this).css({'background': 'none'});">
<tbody>
<tr><td align="left" width="100%">
<form method='post' name='add_poc_type' action=''>
<input type="hidden" name="form_type" value="add_new_poc_type">
Add Point of Contact Type: <input type="text" id="new_poc_type" class="" name="new_poc_type" value="" size="20">&nbsp;
<input type="submit" value="Add New POC Type" class="button">

</form>
</td>
</tr>
<tr>
<td align="left" width="100%">
<form method='post' name='edit_poc_type' action=''>
<input type="hidden" name="form_type" value="edit_poc_type">
Edit Point of Contact Type: <select id="edit_poc_type" name="edit_poc_type"><cfloop query="get_all"><cfoutput><option value="#get_all.poc_type#" <cfif "#get_all.first_choice#" neq 1><cfelse>style="color:red;"</cfif>>#left(get_all.poc_type,25)#</option></cfoutput></cfloop></select>&nbsp;<input type="text" id="edit_poc_type_text" class="" name="edit_poc_type_text" value="" size="20">
<input type="checkbox" id="editfirst_choice" name="editfirst_choice" value="1">&nbsp;Default?
&nbsp;
<input type="submit" value="Edit POC Type" class="button">

</form>
</td>
</tr>
<tr>
<td align="left" width="100%">
<form method='post' name='delete_poc_type' action=''>
<input type="hidden" name="form_type" value="delete_poc_type">
Delete Point of Contact: <select id="delete_poc_type" name="delete_poc_type"><cfloop query="get_all"><cfoutput><option value="#get_all.poc_type#">#get_all.poc_type#</option></cfoutput></cfloop></select>&nbsp;
<input type="submit" value="Delete POC Type" class="button">
</form>
</td>
</tr>

</tbody>

</table>
<!---    --->
</td>
</tr>


<tr>
<td>
<!---    --->
<cfinvoke component="data" method="get_discipline" returnvariable="discipline">
<table width="100%"  align="left"  id="get_discipline" class="datagrid2" cellspacing="3" onmouseover="$(this).css({'background-color': '#CCCCCC'});" onmouseout="$(this).css({'background': 'none'});">
<tbody>
<tr><td align="left" width="100%">
<form method='post' name='add_discipline' action=''>
<input type="hidden" name="form_type" value="add_new_discipline">
Add Discipline: <input type="text" id="new_discipline" class="" name="new_discipline" value="" size="20">
&nbsp;<input type="submit" value="Add New Discipline" class="button" />
</form>
</td>
</tr>
<tr>
<td align="left" width="100%">
<form method='post' name='edit_discipline' action=''>
<input type="hidden" name="form_type" value="edit_discipline">
Edit Discipline: <select id="edit_discipline" name="edit_discipline"><cfloop query="discipline"><cfoutput><option value="#discipline.discipline#" <cfif "#discipline.first_choice#" neq 
1><cfelse>style="color:red;"</cfif>>#left(discipline.discipline,25)#</option></cfoutput></cfloop></select>&nbsp;<input type="text" id="edit_discipline_text" class="" name="edit_discipline_text" value="" size="20"><input type="checkbox" id="editfirst_choice" name="editfirst_choice" value="1">&nbsp;Default?
&nbsp;
<input type="submit" value="Edit Discipline" class="button">

</form>
</td>
</tr>
<tr>
<td align="left" width="100%">
<form method='post' name='delete_discipline' action=''>
<input type="hidden" name="form_type" value="delete_discipline">
Delete Discipline: <select id="delete_discipline" name="delete_discipline"><cfloop query="discipline"><cfoutput><option value="#discipline.discipline#">#discipline.discipline#</option></cfoutput></cfloop></select>&nbsp;<input type="submit" value="Delete Discipline" class="button">
</form>
</td>
</tr>

</tbody>

</table>
<!---    --->
</td>
</tr>


<tr>
<td>
<!---    --->
<cfinvoke component="data" method="get_gov_type" returnvariable="gov_type">
<table width="100%"  align="left"  id="get_gov_type" class="datagrid2" cellspacing="3" onmouseover="$(this).css({'background-color': '#CCCCCC'});" onmouseout="$(this).css({'background': 'none'});">
<tbody>
<tr><td align="left" width="100%">
<form method='post' name='add_gov_type' action=''>
<input type="hidden" name="form_type" value="add_new_gov_type">
Add Government Type: <input type="text" id="new_gov_type" class="" name="new_gov_type" value="" size="20">&nbsp;
<input type="submit" value="Add New Government Type" class="button" />
</form>
</td>
</tr>
<tr>
<td align="left" width="100%">
<form method='post' name='edit_gov_type' action=''>
<input type="hidden" name="form_type" value="edit_gov_type">
Edit Government Type: <select id="edit_gov_type" name="edit_gov_type"><cfloop query="gov_type"><cfoutput><option value="#gov_type.gov_type#" <cfif "#gov_type.first_choice#" neq 
1><cfelse>style="color:red;"</cfif>>#left(gov_type.gov_type,25)#</option></cfoutput></cfloop></select>&nbsp;<input type="text" id="edit_gov_type_text" class="" name="edit_gov_type_text" value="" size="20">
<input type="checkbox" id="editfirst_choice" name="editfirst_choice" value="1">&nbsp;Default?
&nbsp;
<input type="submit" value="Edit Government Type" class="button">

</form>
</td>
</tr>
<tr>
<td align="left" width="100%">
<form method='post' name='delete_gov_type' action=''>
<input type="hidden" name="form_type" value="delete_gov_type" >
Delete Government Type: <select id="delete_gov_type_select" name="delete_gov_type_select"><cfloop query="gov_type"><cfoutput><option 
value="#gov_type.gov_type_id#">#gov_type.gov_type#</option></cfoutput></cfloop></select>&nbsp;
<input type="submit" value="Delete Government Type" class="button">
</form>
</td>
</tr>

</tbody>

</table>
<!---    --->
</td>
</tr>



</table>



</cffunction>


<cffunction name="POST" returntype="any" access="public">

<cfswitch expression="#form.form_type#">

<cfcase value="add_new_area">
<cfquery name="insert_area" datasource="#session.dsn#">
insert into five_star_areas (area)
values ('#form.new_area#')
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="edit_area">
<cfquery name="insert_area" datasource="#session.dsn#">
update five_star_areas
set
area = '#form.edit_5_star_area_text#'
where area = '#form.edit_5_star_area#'
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="delete_area">
<cfquery name="insert_area" datasource="#session.dsn#">
DELETE FROM five_star_areas
WHERE area = '#form.delete_5_star_area#'
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="add_new_category">
<cfquery name="insert_area" datasource="#session.dsn#">
insert into five_star_area_category (area,five_star_area_category_id)
values ('#form.new_category#','#form.parent_5_star_area#')
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="edit_category">
<cfquery name="insert_area" datasource="#session.dsn#">
update five_star_area_category
set
area = '#form.edit_5_star_category_text#'
where area = '#form.edit_5_star_category#'
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="delete_category">
<cfquery name="insert_area" datasource="#session.dsn#">
DELETE FROM five_star_area_category
WHERE area = '#form.delete_5_star_category#'
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="add_new_company">
<cfquery name="insert_area" datasource="#session.dsn#">
insert into companys (company)
values ('#form.new_company#')
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="edit_company">
<cfquery name="insert_area" datasource="#session.dsn#">

<cfif isdefined("form.editfirst_choice")>
update companys
set
first_choice = '1',
company = '#form.edit_company_text#'
where company = '#form.edit_company#'
<cfelse>
update companys
set
first_choice = '0',
company = '#form.edit_company_text#'
where company = '#form.edit_company#'
</cfif>

</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="delete_company">
<cfquery name="insert_area" datasource="#session.dsn#">
DELETE FROM companys
WHERE company = '#form.delete_company_#'
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="add_new_expertise">
<cfquery name="insert_area" datasource="#session.dsn#">
insert into expertise (expertise)
values ('#form.new_expertise#')
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="edit_expertise">
<cfquery name="insert_area" datasource="#session.dsn#">

<cfif isdefined("form.editfirst_choice")>
update expertise
set
first_choice = '1',
expertise = '#form.edit_expertise_text#'
where expertise = '#form.edit_expertise#'
<cfelse>
update expertise
set
first_choice = '0',
expertise = '#form.edit_expertise_text#'
where expertise = '#form.edit_expertise#'
</cfif>

</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="delete_expertise">
<cfquery name="insert_area" datasource="#session.dsn#">
DELETE FROM expertise
WHERE expertise = '#form.delete_expertise#'
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>


<cfcase value="add_new_poc_type">
<cfquery name="insert_area" datasource="#session.dsn#">
insert into poc_type (poc_type)
values ('#form.new_poc_type#')
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="edit_poc_type">
<cfquery name="insert_area" datasource="#session.dsn#">

<cfif isdefined("form.editfirst_choice")>
update poc_type
set
first_choice = '1',
poc_type = '#form.edit_poc_type_text#'
where poc_type = '#form.edit_poc_type#'
<cfelse>
update poc_type
set
first_choice = '0',
poc_type = '#form.edit_poc_type_text#'
where poc_type = '#form.edit_poc_type#'
</cfif>

</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="delete_poc_type">
<cfquery name="insert_area" datasource="#session.dsn#">
DELETE FROM poc_type
WHERE poc_type = '#form.delete_poc_type#'
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="add_new_discipline">
<cfquery name="insert_area" datasource="#session.dsn#">
insert into discipline (discipline)
values ('#form.new_discipline#')
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="edit_discipline">
<cfquery name="insert_area" datasource="#session.dsn#">

<cfif isdefined("form.editfirst_choice")>
update discipline
set
first_choice = '1',
discipline = '#form.edit_discipline_text#'
where discipline = '#form.edit_discipline#'
<cfelse>
update discipline
set
first_choice = '0',
discipline = '#form.edit_discipline_text#'
where discipline = '#form.edit_discipline#'
</cfif>

</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="delete_discipline">
<cfquery name="insert_area" datasource="#session.dsn#">
DELETE FROM discipline
WHERE discipline = '#form.delete_discipline#'
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="add_new_gov_type">
<cfquery name="insert_area" datasource="#session.dsn#">
insert into gov_type (gov_type)
values ('#form.new_gov_type#')
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="edit_gov_type">
<cfquery name="insert_area" datasource="#session.dsn#">

<cfif isdefined("form.editfirst_choice")>
update gov_type
set
first_choice = '1',
gov_type = '#form.edit_gov_type_text#'
where gov_type = '#form.edit_gov_type#'
<cfelse>
update gov_type
set
first_choice = '0',
gov_type = '#form.edit_gov_type_text#'
where gov_type = '#form.edit_gov_type#'
</cfif>

</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>

<cfcase value="delete_gov_type">
<cfquery name="insert_area" datasource="#session.dsn#">
DELETE FROM gov_type
WHERE gov_type_id = #form.delete_gov_type_select#
</cfquery>
<cflocation addtoken="no" url="#cgi.HTTP_REFERER#">
</cfcase>


</cfswitch>



</cffunction>

</cfcomponent>